/*
 * @Author: your name
 * @Date: 2021-09-30 22:00:24
 * @LastEditTime: 2021-10-01 18:31:24
 * @LastEditors: Please set LastEditors
 * @Description: 将文件合并后的代码,用于提交洛谷
 * @FilePath: \luogu\1.6二分查找\P1024\merge.cpp
 */
#include<iostream>
#include<iomanip>
#include<math.h>
using namespace std;

class Equation
{
private:
    //方程参数
    double m_a;
    double m_b;
    double m_c;
    double m_d;
public:
    Equation(double a, double b, double c, double d);
    ~Equation();

    //函数求值
    double f(double x);
    //在left和right检索答案
    double binarySearch(double left, double right);
};

Equation::Equation(double a, double b, double c, double d)
{
    this->m_a = a;
    this->m_b = b;
    this->m_c = c;
    this->m_d = d;
}

Equation::~Equation()
{
}

double Equation::f(double x)
{
    return this->m_a*x*x*x + this->m_b*x*x + this->m_c*x + this->m_d;
}

double Equation::binarySearch(double leftnum, double rightnum)
{
    //左右指针
    double left = leftnum;
    double right = rightnum;
    
    while(right-left > 1e-7){
        // cout << "l:" << left << " r:" << right << endl;
        double mid = (left+right)/2;
        
        if(this->f(left) * this->f(mid) < 0){
            //区间 [left,mid]
            right = mid;
        }else{
            //区间 (mid,right] 倘若这里每次+0.01就会在第四个数据wc,使用0.005减少误差
            left = mid+0.005;
        }
    }
    return left;
}

int main(){
    double a,b,c,d;
    cin >> a >> b >> c >> d;
    Equation * e = new Equation(a,b,c,d);

    for(int i=-100; i<101; i++){
        //对i~i+0.99进行检查 这里每次都要对左右两个端点进行判断
        if(abs(e->f(i)) < 1e-3){
            //左值为0
            cout << fixed << setprecision(2) << (double)i << " ";
        }else if(abs(e->f(i+0.99)) < 1e-3){
            //右值为0
            cout << fixed << setprecision(2) << (double)(i+0.99) << " ";
        }else if(e->f(i) * e->f(i+0.99) < 0){
            //值在左值和右值之间

            //解在(i,i+0.99)
            double result = e->binarySearch(i,i+0.99);
            // cout << result << endl;
            cout << fixed << setprecision(2) << result << " ";
        }
    }
    return 0;
}


/*
    debug

    input:1 -4.65 2.25 1.4
    output:-0.35 1.00 4.00
*/